package com.nuedu.corejava.ch10.homework;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;
import java.util.Set;

/**
 * 7、从控制台输入若干个单词（输入回车结束）放入集合中，将这些单词排序后（忽略大小写）打印出来。 [选做题]
compareToIgnoreCase(String)

 * @author admin
 *
 */
public class HomeWork7 {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String aString = scanner.nextLine();
		List<String> list = new ArrayList<String>();
		String[] s=   aString.split(",");
		String tmpString = null ;
		for (int i = 1; i < s.length; i++) {
			for (int j = 0; j < s.length-i; j++) {
				if (s[j].compareToIgnoreCase(s[i])<0) {
					tmpString = s[i];
					s[i] = s[j];
					s[j] = tmpString;
				}
			}
		}
		for (int i = 0; i < s.length; i++) {
			list.add(s[i]);
		}
		for (int i = 0; i < list.size(); i++) {
			System.out.println(list.get(i));
		}
	}

}
